package com.chinamobile.iot.handler.model;


/**
 * the subscribe / unsubscribe message in the redis pub/sub queue
 *
 * if the qos = AT_LEAST_ONE and cleanSession == false, then the broker should
 * retain the subscription for a period
 *
 * Created by szl on 2017/7/11.
 */

public class SubscriptionMessage {

     /**
     * the type value
     */
    public final static int TYPE_SUBSCRIBE = 1;
    public final static int TYPE_UNSUBSCIRBE = -1;

    /**
     * the filter of the subscription
     */
    private String filter;
    /**
     * the broker of the client
     */
    private String broker;
    /**
     * the clientId that subscribe the filter
     */
    private String clientId;
    /**
     * -1 : unsubscribe, 1 : subscribe
     */
    private int type;
    /**
     * the qos of this subscription
     */
    private int qos;
    /**
     * the clean session flag in the MqttConnect Message
     */
    private boolean cleanSession;

    public String getFilter() {
        return filter;
    }

    public void setFilter(String filter) {
        this.filter = filter;
    }

    public String getBroker() {
        return broker;
    }

    public void setBroker(String broker) {
        this.broker = broker;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public int getQos() {
        return qos;
    }

    public void setQos(int qos) {
        this.qos = qos;
    }

    public boolean isCleanSession() {
        return cleanSession;
    }

    public void setCleanSession(boolean cleanSession) {
        this.cleanSession = cleanSession;
    }
}
